home *** CD-ROM | disk | FTP | other *** search
- #ifndef _AMIGA_H_
- #define _AMIGA_H_
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
-
- #ifndef WORKBENCH_STARTUP_H
- struct WBStartup;
- #endif
-
- #ifndef DOS_DOSEXTENS_H
- struct DosLibrary;
- #endif
-
- #ifndef EXEC_EXECBASE_H
- struct ExecBase;
- #endif
-
- #ifndef UTILITY_UTILITY_H
- struct UtilityBase;
- #endif
-
- extern struct WBStartup *WorkbenchMessage;
- extern struct DosLibrary *DOSBase;
- extern struct ExecBase *SysBase;
- extern struct UtilityBase *UtilityBase;
-
- /************************************************************************/
-
- #define RETURN_CATASTROPHY (100)
-
- /************************************************************************/
-
- #if defined(__GNUC__)
- # define NORETURN __attribute__((noreturn))
- # define INLINE inline
- # define ALIGN(Variable) Variable __attribute__((aligned(4)))
- # define COMPILER "GNU C " __VERSION__
- # undef CPU
- # if defined(mc68040)
- # define CPU "mc68040"
- # elif defined(mc68030)
- # if defined(__HAVE_68881__)
- # define CPU "mc68ec030/mc68881"
- # else
- # define CPU "mc68ec030"
- # endif
- # elif defined(mc68020)
- # if defined(__HAVE_68881__)
- # define CPU "mc68020/mc68881"
- # else
- # define CPU "mc68020"
- # endif
- # else
- # define CPU "mc68000"
- # endif
- #elif defined(__SASC_510)
- # define NORETURN
- # define INLINE
- # define ALIGN(Variable) __aligned Variable
- # define COMPILER "SAS/C 5.10b"
- # define CPU "mc68000"
- #else
- # error Compiler not supported.
- #endif
-
- /************************************************************************/
-
- void _geta4(void);
-
- /************************************************************************/
-
- #ifdef __SASC
- # ifdef SMALL_DATA
- # define __SAVEDS __saveds
- # else
- # define __SAVEDS
- # endif
- #endif
-
- /************************************************************************/
-
- #if defined(__GNUC__)
- ULONG MyHookEntry(void);
- #elif defined(__SASC)
- ULONG __SAVEDS __asm MyHookEntry(register __a0 struct Hook *, register __a2 APTR, register __a1 APTR);
- #endif
-
- /************************************************************************/
-
- ULONG DataPointerToInteger(void *);
-
- /*----------------------------------------------------------------------*/
-
- #if defined(__GNUC__) && defined(__OPTIMIZE__)
-
- extern inline ULONG __inlined_DataPointerToInteger(void *Pointer)
- {
- union
- {
- void *Pointer;
- ULONG Integer;
- } t;
-
- t.Pointer=Pointer;
- return t.Integer;
- }
-
- #define DataPointerToInteger(Pointer) __inlined_DataPointerToInteger(Pointer)
- #endif /* defined(__GNUC__) && defined(__OPTIMIZE__) */
-
- /*----------------------------------------------------------------------*/
-
- #ifdef __SASC
- #define DataPointerToInteger(Pointer) ((ULONG)(Pointer))
- #endif
-
- /************************************************************************/
-
- #if defined(__GNUC__)
-
- #define FunctionPointerToDataPointer(Pointer) \
- ({union \
- { \
- void *Data; \
- typeof(Pointer) Function; \
- } __Union; \
- __Union.Function=Pointer; \
- __Union.Data})
-
- #elif defined(__SASC)
- #define FunctionPointerToDataPointer(Pointer) ((void *)(Pointer))
- #endif
-
- /************************************************************************/
-
- #ifndef MYLIB
- #define MYLIB
- #endif
-
- #endif /* _AMIGA_H_ */
-